package com.example.demo.controller;

import org.springframework.web.bind.annotation.*;

import java.util.Random;

/**
 * @Author :蕉绿
 * @Date : 2023/3/7 19:26
 * @Version : V1.0
 * @Description :
 */

@RestController
@RequestMapping("/user")
public class UserController {


//    @GetMapping
//    public String GetMethod() {
//        return "执行了GET方法!";
//    }
//
//    @PostMapping
//    public String PostMethod() {
//        return "执行Post方法!";
//    }

    @RequestMapping("/getuser")
    public String getUser() {
        System.out.println("执行了getUser方法");
        return "get user";
    }

    @RequestMapping("/login")
    public String login() {
        System.out.println("执行了 login方法");
        return " login";
    }
    @RequestMapping("/reg")
    public String reg() {
        System.out.println("执行了reg方法");
        return "get reg";
    }

    @RequestMapping("/getnum")
    public Integer getNum() {
        return (new Random().nextInt(10));
    }

}
